/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved.
 */
package com.icinfo.cloud.provider.punish.controller;

import com.icinfo.cloud.provider.punish.dto.AppDocumentTemporaryRecordSaveDto;
import com.icinfo.cloud.provider.punish.dto.ZtcCurrentUserTemporaryInfoDto;
import com.icinfo.cloud.provider.punish.service.IAppCaseBeforeDocumentTemporaryRecordService;
import com.icinfo.cloud.provider.punish.vo.AppDocumentCurrentUserTemporaryVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 办案直通车文书暂存
 *
 * @author Junfeng.Chen
 * @date 2024/1/10 11:22
 **/
@RestController
@RequestMapping("/app/document/temporary")
public class AppCaseBeforeDocumentTemporaryRecordController extends BaseController {
    @Resource
    private IAppCaseBeforeDocumentTemporaryRecordService appCaseBeforeDocumentTemporaryRecordService;

    /**
     * 办案直通车文书暂存
     *
     * @param dto 需要保存的直通车文书的参数
     */
    @PostMapping("/save")
    public Result save(@RequestBody @Validated AppDocumentTemporaryRecordSaveDto dto) {
        appCaseBeforeDocumentTemporaryRecordService.save(dto);
        return Result.success("保存成功");
    }

    /**
     * 获取当前用户暂存信息
     *
     * @param dto
     * @return 当前用户暂存信息对象
     */
    @GetMapping("/getCurrentUserTemporaryInfo")
    public Result<AppDocumentCurrentUserTemporaryVo> getCurrentUserTemporaryInfo(@Validated ZtcCurrentUserTemporaryInfoDto dto) {
        return Result.success(appCaseBeforeDocumentTemporaryRecordService.getCurrentUserTemporaryInfo(dto));
    }
}
